#include "turntable.h"
#include <QHBoxLayout>
#include <QPainter>

#include "turntable.h"
#include <QHBoxLayout>
#include <QPainter>
#include <QSizePolicy>

TurnTable::TurnTable(QWidget *parent)
    : QWidget{parent}
{
    setAttribute(Qt::WA_TranslucentBackground,true); //背景透明
}

void TurnTable::loadPicture(QString fileName)
{
    QLabel* m_Label = new QLabel;
    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->setAlignment(Qt::AlignCenter);
    layout->addWidget(m_Label);

    QPixmap pixmap(fileName);
    m_Label->setPixmap(pixmap.scaled(m_Label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
}

